import { Rules, Values } from 'async-validator'
import { InjectionKey } from 'vue'

export type FormData = {
  model: Record<string, unknown>
  rules: Rules
}

export type FormItem = {
  validator: () => Promise<Values>
}

export type FormType = {
  validator: (callback: (isValidator: boolean) => void) => Promise<Values>
}

export const key: InjectionKey<FormData> = Symbol('form-data')
